package servlet;

import dao.UserDAO1;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name="userstatus",value = "/user/status")
public class UserStatusServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp)throws ServletException, IOException {
        //获取post请求参数乱码问题
        req.setCharacterEncoding("UTF-8");
        //1.
        String id=req.getParameter("id");

        UserDAO1 userDAO1=new UserDAO1();
        userDAO1.updateStatus(id);

        req.getRequestDispatcher( "/user/list").forward(req,resp);

    }
}
